﻿using System;
using System.Linq;

class MinAndMax
{
    static void Main()
    {
        //Write a program that reads from the console a sequence of N integer numbers and returns the minimal and maximal of them.

        Console.Write("N = ");
        int n = int.Parse(Console.ReadLine());
        int max = int.MinValue;
        int min = int.MaxValue;
        for (int i = 1; i <= n; i++)
        {
            Console.Write("Enter a number: "); 
            int number = int.Parse(Console.ReadLine());
            if (number > max)
            {
                max = number;
            }
            if (number < min)
            {
                min = number;
            }
        }
        Console.WriteLine("The min number is " + min);
        Console.WriteLine("The max number is " + max);        
    }
}
